import request from './apis'
// Back pay， Run！Boss brute, four months back pay and he likes to withhold money,not recommended to stay
enum Api {
  data = '/unit/MyXf/Lists?type=2',
  markList = '/unit/Danger/Lists',
  warnTrend = '/unit/Dashboard/WarnTrend',
  warnTrendList = '/unit/Dashboard/warnTrendList',
  warnTrendListExcel = '/unit/Dashboard/warnTrendListExcel',
  pcindexPatro = '/unit/PublicShow/pcindexPatrol',
  pclndexRanking = '/unit/PublicShow/pcIndexRanking',
  pclndexRankingAll = '/unit/PublicShow/allSubUnitScoreList',
  pclndexRankingExcl = '/unit/PublicShow/allDeriveScoreList',
  homeTaskList = '/unit/PublicShow/homeTaskList',
  homeTaskListExcl = '/unit/PublicShow/homeTaskListExcl',
  roomList = '/unit/YjUnit/SubUnitLists',
  listsExclV2 = '/unit/MyXf/listsExclV2?type=2',
  myXfExamine = '/unit/MyXf/Examine',
}

export const dataList = (params) => {
  return request.get(Api.data, { params })
}

export const myXfExamine = (data) => {
  return request.post(Api.myXfExamine, data)
}

export const markList = (params) => {
  return request.get(Api.markList, { params })
}
//警情日报折线图
export const warnTrend = (params) => {
  return request.get(Api.warnTrend, { params })
}
// 商户巡查图表数据
export const pcindexPatro = (params) => {
  return request.get(Api.pcindexPatro, { params })
}
//商户排名数据
export const pclndexRanking = (params) => {
  return request.get(Api.pclndexRanking, { params })
}
//商户列表数据
export const roomList = (params) => {
  return request.get(Api.roomList, { params })
}

export const homeTaskList = (data) => {
  return request.post(Api.homeTaskList, data)
}

export const homeTaskListExcl = (data) => {
  return request.post(Api.homeTaskListExcl, data, {
    responseType: 'blob'
  })
}

export const pclndexRankingExcl = (data) => {
  return request.post(Api.pclndexRankingExcl, data, {
    responseType: 'blob'
  })
}
export const pclndexRankingAll = (data) => {
  return request.post(Api.pclndexRankingAll, data)
}
export const warnTrendList = (data) => {
  return request.post(Api.warnTrendList, data)
}
export const warnTrendListExcel = (data) => {
  return request.post(Api.warnTrendListExcel, data, {
    responseType: 'blob'
  })
}

export const listsExclV2 = (data) => {
  return request.post(Api.listsExclV2, data, {
    responseType: 'blob'
  })
}
